﻿using System;
using System.IO;

namespace Tequila.Phone.Sharing
{
    /// <summary>
    /// File storage manager.
    /// </summary>
    public interface IFileStorageManager
    {
        /// <summary>
        /// When implemented, generates unique image path.
        /// </summary>
        /// <returns></returns>
        string GenerateUniqueImagePath();
        /// <summary>
        /// When implemented, generates unique html path.
        /// </summary>
        /// <returns></returns>
        string GenerateUniqueHtmlPath();
        /// <summary>
        /// When implemented, saves stream source.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="localPath"></param>
        void SaveFile(Stream source, string localPath);
        /// <summary>
        /// When implemented, saves content.
        /// </summary>
        /// <param name="content"></param>
        /// <param name="localPath"></param>
        void SaveFile(string content, string localPath);
        /// <summary>
        /// When implemented, copies source content to destination content.
        /// </summary>
        /// <param name="sourcePath"></param>
        /// <param name="destPath"></param>
        void CopyFile(string sourcePath, string destPath);
        /// <summary>
        /// When implemented, determines whether object exists or not.
        /// </summary>
        /// <param name="localPath"></param>
        /// <returns></returns>
        bool IsExists(string localPath);
        /// <summary>
        /// When implemented, removes the file.
        /// </summary>
        /// <param name="localPath"></param>
        void DeleteFile(string localPath);
        /// <summary>
        /// When implemented, reads content by provided path.
        /// </summary>
        /// <param name="localPath"></param>
        /// <returns></returns>
        string ReadFile(string localPath);
        /// <summary>
        /// When implemented, opens content by provided path as <see cref="Stream">stream</see>.
        /// </summary>
        /// <param name="localPath"></param>
        /// <returns></returns>
        Stream OpenFile(string localPath);
        /// <summary>
        /// When implemented, creates <see cref="Stream">stream</see> containing content.
        /// </summary>
        /// <param name="localPath"></param>
        /// <returns></returns>
        Stream CreateFile(string localPath);
        /// <summary>
        /// When implemented, determines the last update time of content by provided path.
        /// </summary>
        /// <param name="localPath"></param>
        /// <returns></returns>
        DateTimeOffset GetLastUpdateTime(string localPath);
    }
}
